﻿<!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
-->

<UserControl
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"

  xmlns:samplesCommon="clr-namespace:System.Windows.Controls.Samples;assembly=System.Windows.Controls.Samples.Common"
  xmlns:system="clr-namespace:System;assembly=mscorlib"
  x:Class="System.Windows.Controls.Samples.TreeViewSample">
    <StackPanel>
        <!-- Basic TreeView -->
        <ContentControl Content="TreeView" Style="{StaticResource Header}" />
        <TextBlock Style="{StaticResource Information}">
            TreeView is a control that displays hierarchical data in a tree
            structure with items that can expand and collapse.
        </TextBlock>
        <toolkit:TreeView Margin="5">
            <toolkit:TreeViewItem Header="Controls">
                <toolkit:TreeViewItem Header="AutoCompleteBox" />
                <toolkit:TreeViewItem Header="Expander" />
                <toolkit:TreeViewItem Header="NumericUpDown" />
            </toolkit:TreeViewItem>
            <toolkit:TreeViewItem Header="Layout">
                <toolkit:TreeViewItem Header="DockPanel" />
                <toolkit:TreeViewItem Header="WrapPanel" />
                <toolkit:TreeViewItem Header="Viewbox" />
            </toolkit:TreeViewItem>
            <toolkit:TreeViewItem Header="Charting">
                <toolkit:TreeViewItem Header="ColumnSeries" />
                <toolkit:TreeViewItem Header="LineSeries" />
                <toolkit:TreeViewItem Header="PieSeries" />
            </toolkit:TreeViewItem>
        </toolkit:TreeView>
        
        <!-- TreeViewItems -->
        <ContentControl Content="TreeViewItem" Style="{StaticResource Header}" />
        <TextBlock Style="{StaticResource Information}">
            TreeViews are composed of TreeViewItems which can be added to the
            TreeView.Items collection or assigned to the TreeView.ItemsSource
            property.  Objects of any type can be added and will be wrapped with
            TreeViewItems.
        </TextBlock>
        <toolkit:TreeView Margin="5">
            <toolkit:TreeViewItem Header="TreeViewItems">
                <toolkit:TreeViewItem Header="Can be nested">
                    <toolkit:TreeViewItem Header="To any depth" />
                </toolkit:TreeViewItem>
                <toolkit:TreeViewItem Header="And disabled" IsEnabled="False" />
                <toolkit:TreeViewItem Header="And formatted" Foreground="Purple" FontStyle="Italic" FontSize="12" />
                <toolkit:TreeViewItem Header="Or created">
                    <toolkit:TreeViewItem Header="From objects">
                        <system:String>String</system:String>
                        <system:Int32>42</system:Int32>
                        <system:Double>3.14159</system:Double>
                    </toolkit:TreeViewItem>
                    <toolkit:TreeViewItem Header="From UIElements">
                        <Button Content="Button" />
                        <CheckBox Content="CheckBox" />
                        <TextBox Text="TextBox" />
                    </toolkit:TreeViewItem>
                </toolkit:TreeViewItem>
            </toolkit:TreeViewItem>
            <toolkit:TreeViewItem Header="Setting Items">
                <toolkit:TreeViewItem Header="Via Items">
                    <system:String>First</system:String>
                    <system:String>Second</system:String>
                    <system:String>Third</system:String>
                </toolkit:TreeViewItem>
                <toolkit:TreeViewItem Header="Via ItemsSource">
                    <toolkit:TreeViewItem.ItemsSource>
                        <toolkit:ObjectCollection>
                            <system:String>First</system:String>
                            <system:String>Second</system:String>
                            <system:String>Third</system:String>
                        </toolkit:ObjectCollection>
                    </toolkit:TreeViewItem.ItemsSource>
                </toolkit:TreeViewItem>
            </toolkit:TreeViewItem>
        </toolkit:TreeView>
        
        <src:SourceViewer xmlns:src="clr-namespace:System.Windows.Controls.Samples;assembly=System.Windows.Controls.Samples.Common" xmlns:sys="clr-namespace:System;assembly=mscorlib">
  <src:SourceFile Path="TreeViewSample.xaml">
    <src:SourceFile.Source>
      <sys:String>&lt;!--
// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.
--&gt;

&lt;UserControl
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:toolkit="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Toolkit"

  xmlns:samplesCommon="clr-namespace:System.Windows.Controls.Samples;assembly=System.Windows.Controls.Samples.Common"
  xmlns:system="clr-namespace:System;assembly=mscorlib"
  x:Class="System.Windows.Controls.Samples.TreeViewSample"&gt;
    &lt;StackPanel&gt;
        &lt;!-- Basic TreeView --&gt;
        &lt;ContentControl Content="TreeView" Style="{StaticResource Header}" /&gt;
        &lt;TextBlock Style="{StaticResource Information}"&gt;
            TreeView is a control that displays hierarchical data in a tree
            structure with items that can expand and collapse.
        &lt;/TextBlock&gt;
        &lt;toolkit:TreeView Margin="5"&gt;
            &lt;toolkit:TreeViewItem Header="Controls"&gt;
                &lt;toolkit:TreeViewItem Header="AutoCompleteBox" /&gt;
                &lt;toolkit:TreeViewItem Header="Expander" /&gt;
                &lt;toolkit:TreeViewItem Header="NumericUpDown" /&gt;
            &lt;/toolkit:TreeViewItem&gt;
            &lt;toolkit:TreeViewItem Header="Layout"&gt;
                &lt;toolkit:TreeViewItem Header="DockPanel" /&gt;
                &lt;toolkit:TreeViewItem Header="WrapPanel" /&gt;
                &lt;toolkit:TreeViewItem Header="Viewbox" /&gt;
            &lt;/toolkit:TreeViewItem&gt;
            &lt;toolkit:TreeViewItem Header="Charting"&gt;
                &lt;toolkit:TreeViewItem Header="ColumnSeries" /&gt;
                &lt;toolkit:TreeViewItem Header="LineSeries" /&gt;
                &lt;toolkit:TreeViewItem Header="PieSeries" /&gt;
            &lt;/toolkit:TreeViewItem&gt;
        &lt;/toolkit:TreeView&gt;
        
        &lt;!-- TreeViewItems --&gt;
        &lt;ContentControl Content="TreeViewItem" Style="{StaticResource Header}" /&gt;
        &lt;TextBlock Style="{StaticResource Information}"&gt;
            TreeViews are composed of TreeViewItems which can be added to the
            TreeView.Items collection or assigned to the TreeView.ItemsSource
            property.  Objects of any type can be added and will be wrapped with
            TreeViewItems.
        &lt;/TextBlock&gt;
        &lt;toolkit:TreeView Margin="5"&gt;
            &lt;toolkit:TreeViewItem Header="TreeViewItems"&gt;
                &lt;toolkit:TreeViewItem Header="Can be nested"&gt;
                    &lt;toolkit:TreeViewItem Header="To any depth" /&gt;
                &lt;/toolkit:TreeViewItem&gt;
                &lt;toolkit:TreeViewItem Header="And disabled" IsEnabled="False" /&gt;
                &lt;toolkit:TreeViewItem Header="And formatted" Foreground="Purple" FontStyle="Italic" FontSize="12" /&gt;
                &lt;toolkit:TreeViewItem Header="Or created"&gt;
                    &lt;toolkit:TreeViewItem Header="From objects"&gt;
                        &lt;system:String&gt;String&lt;/system:String&gt;
                        &lt;system:Int32&gt;42&lt;/system:Int32&gt;
                        &lt;system:Double&gt;3.14159&lt;/system:Double&gt;
                    &lt;/toolkit:TreeViewItem&gt;
                    &lt;toolkit:TreeViewItem Header="From UIElements"&gt;
                        &lt;Button Content="Button" /&gt;
                        &lt;CheckBox Content="CheckBox" /&gt;
                        &lt;TextBox Text="TextBox" /&gt;
                    &lt;/toolkit:TreeViewItem&gt;
                &lt;/toolkit:TreeViewItem&gt;
            &lt;/toolkit:TreeViewItem&gt;
            &lt;toolkit:TreeViewItem Header="Setting Items"&gt;
                &lt;toolkit:TreeViewItem Header="Via Items"&gt;
                    &lt;system:String&gt;First&lt;/system:String&gt;
                    &lt;system:String&gt;Second&lt;/system:String&gt;
                    &lt;system:String&gt;Third&lt;/system:String&gt;
                &lt;/toolkit:TreeViewItem&gt;
                &lt;toolkit:TreeViewItem Header="Via ItemsSource"&gt;
                    &lt;toolkit:TreeViewItem.ItemsSource&gt;
                        &lt;toolkit:ObjectCollection&gt;
                            &lt;system:String&gt;First&lt;/system:String&gt;
                            &lt;system:String&gt;Second&lt;/system:String&gt;
                            &lt;system:String&gt;Third&lt;/system:String&gt;
                        &lt;/toolkit:ObjectCollection&gt;
                    &lt;/toolkit:TreeViewItem.ItemsSource&gt;
                &lt;/toolkit:TreeViewItem&gt;
            &lt;/toolkit:TreeViewItem&gt;
        &lt;/toolkit:TreeView&gt;
    &lt;/StackPanel&gt;
&lt;/UserControl&gt;</sys:String>
    </src:SourceFile.Source>
  </src:SourceFile>
  <src:SourceFile Path="TreeViewSample.xaml.cs">
    <src:SourceFile.Source>
      <sys:String>// (c) Copyright Microsoft Corporation.
// This source is subject to the Microsoft Public License (Ms-PL).
// Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
// All other rights reserved.

using System;
using System.Diagnostics.CodeAnalysis;
using System.Windows;
using System.Windows.Controls;
using System.ComponentModel;

namespace System.Windows.Controls.Samples
{
    /// &lt;summary&gt;
    /// Sample page demonstrating the TreeView.
    /// &lt;/summary&gt;
    [Sample("(0)TreeView", DifficultyLevel.Basic)]
    [Category("TreeView")]
    public partial class TreeViewSample : UserControl
    {
        /// &lt;summary&gt;
        /// Initializes a new instance of the TreeViewSample class.
        /// &lt;/summary&gt;
        public TreeViewSample()
        {
            InitializeComponent();
        }
    }
}</sys:String>
    </src:SourceFile.Source>
  </src:SourceFile>
  <src:SourceFile Path="TreeViewSample.xaml.vb">
    <src:SourceFile.Source>
      <sys:String>' (c) Copyright Microsoft Corporation.
' This source is subject to the Microsoft Public License (Ms-PL).
' Please see http://go.microsoft.com/fwlink/?LinkID=131993 for details.
' All other rights reserved.

Imports Microsoft.VisualBasic
Imports System
Imports System.Diagnostics.CodeAnalysis
Imports System.Windows
Imports System.Windows.Controls
Imports System.ComponentModel

''' &lt;summary&gt;
''' Sample page demonstrating the TreeView.
''' &lt;/summary&gt;
&lt;Sample("(0)TreeView", DifficultyLevel.Basic), Category("TreeView")&gt; _
Partial Public Class TreeViewSample
    Inherits UserControl
    ''' &lt;summary&gt;
    ''' Initializes a new instance of the TreeViewSample class.
    ''' &lt;/summary&gt;
    Public Sub New()
        InitializeComponent()
    End Sub
End Class
</sys:String>
    </src:SourceFile.Source>
  </src:SourceFile>
</src:SourceViewer>
    </StackPanel>
</UserControl>